package com.sw.bbs.board.dao;

import com.sw.bbs.board.pojo.Board;
import com.sw.bbs.board.vo.request.board.QueryBoardRequest;
import com.sw.bbs.board.vo.response.board.BoardOperaResponse;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface BoardMapper {
    int deleteByPrimaryKey(Integer boardId);

    int insert(Board record);

    int insertSelective(Board record);

    Board selectByPrimaryKey(Integer boardId);

    int updateByPrimaryKeySelective(Board record);


    int updateByPrimaryKey(Board record);


    /**
     * 根据筛选条件选出板块列表
     * @param request
     * @return
     */
    List<Board> queryQueryListResponse(QueryBoardRequest request);

    /**
     * 根据用户ID获取用户创建的板块
     * @param userId
     * @return
     */
    List<Board> queryBoardsByUserId(@Param("userId") Integer userId);


    /**
     * 根据用户ID跟类型获取板块
     * @param userId
     * @return
     */
    List<BoardOperaResponse> queryProfileBoardsByType(@Param("userId") Integer userId,
                                                      @Param("type")Integer type);








}